<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<head>
    <title>标准详情</title>

    <link rel="stylesheet" href="${ctx}/static/styles/std_detail.css" type="text/css">
    <script src="${ctx}/static/js/pdfobject.min.js"></script>

    <c:if test="${!empty exists}">
        <script>
            document.onreadystatechange = function () {
                if (document.readyState == "complete") {
                    PDFObject.embed("${ctx}/resource/docs/${std.catStd}/${std.pdfPath}", "#ex");
                }
            }
        </script>
    </c:if>
</head>

<body>
<div class="std-main">
    <div class="container">
        <h5>标准详情</h5>
        <div class="std-detail">
            <div class="std-name">
                <h2>${std.titleCn}</h2>
                <p>标准号：${std.name}</p>
            </div>
            <div class="std-info">
                <p>中文名称：${std.titleCn}</p>
                <p>英文名称：${std.titleEn}</p>
                <p>标准发布时间：<fmt:formatDate value="${std.publishDate}" type="date" dateStyle="long"/></p>
                <p>标准生效时间：<fmt:formatDate value="${std.effectiveDate}" type="date" dateStyle="long"/></p>
            </div>
            <div class="row" style="margin:auto">
                <div class="col-xs-6 col-md-3" style="padding: 0">
                    <div class="thumbnail">
                        <a href="${ctx}/std/ref/${std.id}">
                            <img src="${ctx}/static/images/safari.png" alt="引用标准">
                        </a>
                        <div class="caption">
                            <h4>引用标准</h4>
                        </div>
                    </div>
                </div>
                <div class="col-xs-6 col-md-3" style="padding: 0">
                    <div class="thumbnail">
                        <a href="#">
                            <img src="${ctx}/static/images/editor.png" alt="术语信息">
                        </a>
                        <div class="caption">
                            <h4>术语信息</h4>
                        </div>
                    </div>
                </div>
                <div class="col-xs-6 col-md-3" style="padding: 0">
                    <div class="thumbnail">
                        <a href="${ctx}/std/elements/${std.id}" class="">
                            <img src="${ctx}/static/images/idea.png" alt="其它知识元素">
                        </a>
                        <div class="caption">
                            <h4>标准元素</h4>
                        </div>
                    </div>
                </div>
                <div class="col-xs-6 col-md-3" style="padding: 0">
                    <div class="thumbnail">
                        <a href="${ctx}/std/quotas/${std.id}" class="">
                            <img src="${ctx}/static/images/generic.png" alt="指标要素">
                        </a>
                        <div class="caption">
                            <h4>指标要素</h4>
                        </div>
                    </div>
                </div>
            </div>
        </div>



        <c:if test="${!empty exists}">
            <div id="ex" class="std-pdfshow">
                ====
            </div>
        </c:if>
        <c:if test="${empty exists}">
            <div id="ex" class="std-pdfnoshow">
                <p>该标准不存在PDF版本，请联系管理员索取。</p>
                <p style="font-size:16px">如有需要，请到<a href="${ctx}/infor/index">需求反馈页面</a>提交需求。</p>
            </div>
        </c:if>

        <!-- Button trigger modal -->
        <a class="std-detail-another" data-toggle="modal" data-target="#myModal">
            查看OCR全文
        </a>
    </div>
</div>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">OCR文本详情</h4>
            </div>
            <div class="modal-body">
                ${std.textOcr}
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary">Save changes</button>
            </div>
        </div>
    </div>
</div>

</body>
</html>
